package com.xmtlxx.oms.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.oms.domain.Staging;
import com.xmtlxx.oms.domain.bo.StagingBo;
import com.xmtlxx.oms.domain.vo.StagingInfoVo;
import com.xmtlxx.oms.domain.vo.StagingVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 暂存登记Mapper接口
 *
 * @author xmtlxx
 * @date 2022-11-20
 */
public interface StagingMapper extends BaseMapperPlus<StagingMapper, Staging, StagingVo> {
    /**
     * 根据条件分页查询暂存登记
     *
     * @param staging 暂存登记
     * @return Page Staging
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.office_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<StagingVo> selectPageStagingList(@Param("page") Page<Staging> page, @Param("staging") StagingBo staging);

    Page<StagingInfoVo> getStagingPageList(@Param("page") Page<Staging> page, @Param("staging") StagingBo staging);

    Page<StagingInfoVo> getXzProList(@Param("page") Page<Staging> page, @Param("staging") StagingBo staging);

    StagingVo getStagingInfoByPno(@Param("pno") String pno);

    /**
     * 查询暂存登记列表
     *
     * @param staging 暂存登记
     * @return 暂存登记集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "s.create_by"),
        @DataColumn(key = "deptName", value = "s.office_id"),
        @DataColumn(key = "userName", value = "s.create_by")
    })
    List<StagingVo> selectStagingList(@Param("staging") StagingBo staging);

    StagingVo selectStagingVoByID(String id);

    StagingVo getVoByPno(String pno);

    Boolean deleteVoById(String id);

    /**
     * 查询以登记非中心财物
     * @author hergreen
     * @date 2024/12/26 16:55
     * @param page 分页
     * @param proNo 财物编号
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.xmtlxx.oms.domain.vo.StagingVo>
     */
    @DataPermission({
            @DataColumn(key = "tenantName", value = "s.create_by"),
            @DataColumn(key = "deptName", value = "s.office_id"),
            @DataColumn(key = "userName", value = "s.create_by")
    })
    Page<StagingVo> getNotCanterProList(@Param("page") Page<StagingVo> page, @Param("proNo") String proNo);

    /**
     *
     * @param pno
     * @return
     */
    StagingVo getXzProByPno(@Param("pno") String pno);

}
